package org.ehe.business.project.service;

import com.baomidou.mybatisplus.extension.service.IService;
import jakarta.servlet.http.HttpServletResponse;
import org.ehe.business.project.domain.ProjectAssignmentEntity;
import org.ehe.business.project.domain.ProjectEntity;
import org.ehe.business.project.domain.ProjectSolution;
import org.ehe.business.project.domain.bo.ProjectEntityBo;
import org.ehe.business.project.domain.dto.ProjectCreateRequest;
import org.ehe.business.project.domain.dto.ProjectSearchRequest;
import org.ehe.business.project.domain.vo.ProjectProgressVO;
import org.ehe.business.project.domain.vo.ProjectVo;
import org.ehe.common.mybatis.core.page.PageQuery;
import org.ehe.common.mybatis.core.page.TableDataInfo;

import java.util.List;
import java.util.Map;

/**
 * @author :zhangnn
 * @className :ProjectService
 * @description: 项目管理Service
 * @date 2025-07-16 11:16:26
 */
public interface ProjectService extends IService<ProjectEntity> {

    /**
     * 获取工程师负责项目
     * @param id
     * @return
     */
    TableDataInfo<ProjectAssignmentEntity> getEngineerProjects(Long id,PageQuery query);

    /**
     * 创建项目
     * @param request
     * @return
     */
    Long createProject(ProjectCreateRequest request);

    /**
     * 分配项目
     * @param projectId
     * @param engineerId
     * @return
     */
    ProjectAssignmentEntity assignProject(Long projectId, Long engineerId);

    /**
     * 分页
     * @param project
     * @param pageQuery
     * @return
     */
    TableDataInfo<ProjectVo> selectPageProjectList(ProjectEntityBo project, PageQuery pageQuery);

    /**
     * 获取项目详情
     * @param projectId
     * @return
     */
    ProjectEntity getProjectDetail(Long projectId);

    /**
     * 项目树形接口
     * @return
     */
    List<ProjectEntity> getProjectTree(ProjectEntityBo bo);

    /**
     * 更新项目状态
     * @param projectId
     * @param status
     */
    void updateProjectStatus(Long projectId, String status);

    /**
     * 删除项目
     * @param projectId
     */
    void deleteProject(Long projectId);

    /**
     * 更新项目
     * @param projectId
     * @param request
     */
    void updateProject(Long projectId, ProjectCreateRequest request);

    /**
     * 搜索
     * @param request
     * @return
     */
    List<ProjectEntity> searchProjects(ProjectSearchRequest request);

    /**
     * 获取项目统计信息
     * @return
     */
    Map<String, Object> getProjectStatistics();

    /**
     * 批量删除
     * @param projectIds
     */
    void batchDeleteProjects(List<Long> projectIds);

    /**
     * 批量更新状态
     * @param projectIds
     * @param status
     */
    void saveOrUpdateBatch1(List<Long> projectIds, String status);

    /**
     * 项目进度
     * @param startDate
     * @param endDate
     * @return
     */
    List<ProjectProgressVO> getProjectProgressReport(String startDate, String endDate);

    /**
     * 数据导出
     * @param response
     * @param status
     * @param difficulty
     */
    void exportProjects(HttpServletResponse response, String status, String difficulty);

    String checkProjectDifficultyByLevel(ProjectCreateRequest request);

    /**
     * 修改项目预估小时数
     * @param projectId
     * @param estimatedHours
     */
    void updateProjectEstimatedHours(Long projectId, int estimatedHours);

    ProjectEntity approveProject(Long projectId, String auditUser);

    ProjectEntity rejectProject(Long solutionId, String auditUser);

    /**
     * 提交项目
     * @param projectId
     */
    ProjectEntity submitProject(Long projectId);
}
